<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>CMS</title>
		<link href="css/bootstrap.min.css" rel="stylesheet">
		<link href="css/jumbotron.css" rel="stylesheet">
		<link href="css/font-awesome.min.css" rel="stylesheet">
		<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
		<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
		<!--[if lt IE 9]>
    <script src="js/html5shiv.min.js"></script>
    <script src="js/respond.min.js"></script>
    <![endif]-->
		<!--<link href="css/nav.css" rel="stylesheet">-->
	</head>

	<body>
		<nav class="navbar navbar-inverse navbar-fixed-top"></nav>

		<div>
			<div class="container">
				<ul class="nav nav-tabs">
					<li class="active">
						<a href="javascript:reLoad();">弹幕</a>
					</li>
				</ul>
			</div>

			<div class="container">
				&nbsp;
			</div>

			<div class="container">
				<div class="panel panel-default">
					<div class="panel-heading">
						<button type="button" class="btn btn-link" data-toggle="modal" data-target="#newModal" data-ext="add">添加弹幕</button>
					</div>
					<div class="table-responsive">
						<form id="form">
							<table class="table table-hover table-striped">
								<thead>
									<tr>
										<th>#</th>
										<th>开始/结束时间</th>
										<th class="col-md-3">中文/英文</th>
										<th>弹幕ID</th>
										<th>删除</th>
									</tr>
								</thead>
								<tbody id="table-body"></tbody>
								<!--<tr>
									<td colspan="5" class="text-right">
										<button type="button" style="float: right;" class="btn btn-primary" id="btn-sub">排序</button>
									</td>
								</tr>-->
							</table>
						</form>
					</div>
				</div>
			</div>
		</div>

		<script src="js/jquery.min.js"></script>
		<script src="js/bootstrap.min.js"></script>
		<script src="js/url.min.js"></script>
		<script src="js/common.js"></script>
		<script language="JavaScript">
			var id = $.url('?id');
			var message;
			auth();
        	menu("lesson");
        	$(".container").filter(":last").after(newModal);
			$(function() {
				if(id != null && id > 0) {
					api.lessonComment({
						id: id
					});
				}
				
				
				$('#newModal').on('show.bs.modal', function (event) {
		            var button = $(event.relatedTarget);
		            var ext = button.data('ext');
		            var recipient = button.data('whatever');
		            var title = button.data('rowid');
		            var src = "";
		            switch(ext)
		            {
		                case "add":
		                    title = "添加关联";
		                    src = "lesson_comments_add.html?id="+id;
		                    break;
		            }
		            var modal = $(this);
		            modal.find('.modal-title').text(title);
		            $("#newiframe").attr("src", src);
		        });
			})
		</script>
	</body>

</html>